package com.gzyj.jtt808.v2011.enums;

import lombok.Getter;

/**
 * @author lhj
 */
@Getter
public enum JT808TerminalResult {
    成功_确认(0, "成功/确认"),
    失败(1, "失败"),
    消息有误(2, "消息有误"),
    不支持(3, "不支持"),
    ;

    private int code;
    private String name;

    JT808TerminalResult(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static JT808TerminalResult find(int code) {
        for (JT808TerminalResult result : JT808TerminalResult.values()) {
            if (result.getCode() == code) {
                return result;
            }
        }
        return null;
    }
}
